package two_xia.myPainter;

import javax.swing.*;

public class Client {
    // 主函数入口

    public static void main(String[] args) {
        SwingUtilities.invokeLater(() -> {
            DrawingBoard drawingBoard = new DrawingBoard();
            drawingBoard.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            drawingBoard.setVisible(true);
            drawingBoard.repaint();

            /* 模拟命令模式:
                     DrawingApp app = new DrawingApp(canvas);
                     这些命令通过监听鼠标事件创建;对应DrawListener
                     Command lineCommand = new DrawLineCommand(new Point(0, 0), new Point(100, 100), canvas);
                     Command circleCommand = new DrawCircleCommand(new Point(50, 50), 30, canvas);
                      这些命令都有记录在shapeArray中
                     app.draw(lineCommand);
                     app.draw(circleCommand);*/

            /*模拟组合模式:
            JPanel drawingBoard1 = new JPanel();
            JPanel DrawingArea = new JPanel();
            JPanel CustomColorPanel = new JPanel();
            JComponent colorComponent = new JComponent();

            CustomColorPanel.add(colorComponent);
            drawingBoard1.add(DrawingArea);
            drawingBoard1.add(CustomColorPanel);

            JPanel StrokeChange = new JPanel();
            JComponent strokeComponent = new JComponent();

            CustomColorPanel.add(StrokeChange);
            StrokeChange.add(strokeComponent);
             */


        });
    }
}
